import {ChangeDetectorRef, Component} from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import {JidihttpProvider} from "../../providers/jidihttp/jidihttp";
import {DomSanitizer} from "@angular/platform-browser";

/**
 * Generated class for the BaikelistinfoPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-baikelistinfo',
  templateUrl: 'baikelistinfo.html',
})
export class BaikelistinfoPage {
  baikeid:string;
  baike_name:string;
  baike_time:string;
  baike_img:string;
  baike_remark:string;
  baike_content:string;

  constructor(public sanitizer:DomSanitizer,public navCtrl: NavController, public navParams: NavParams,public cdchange:ChangeDetectorRef,public jidiProvider:JidihttpProvider) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad BaikelistinfoPage');
    this.baikeid=this.navParams.get('uuid')
    this.baikehttpInfoClinet(this.baikeid);
  }
  /** 网络请求 **/
  baikehttpInfoClinet(uuid){
    this.jidiProvider.getBaikeJIangtangInfoHttp(uuid).subscribe(data => {
      this.baike_name = data['data']["title"];
      this.baike_time = data['data']["createTime"];
      this.baike_img = data['data']["img"];
      this.baike_remark = data['data']["remark"];
      this.baike_content = data['data']["content"];
      this.cdchange.detectChanges();
    },error => {

    });

  }
  assembleHTML(strHTML:any){
    return this.sanitizer.bypassSecurityTrustHtml(strHTML);
  }
}
